package com.chenglai.seckill.feign;

import com.chenglai.seckill.entity.MainOrder;
import com.chenglai.seckill.entity.Order;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;
import java.util.Map;

/**
 * 类描述：
 *
 * @Author rxh
 * @Date 2023/11/24 11:08
 */
@FeignClient(value = "order", fallbackFactory = OrderFallback.class)
public interface OrderService {

    @GetMapping("/order/addMainOrder")
    String addMainOrder(@RequestParam(value = "mainOrder") MainOrder mainOrder, @RequestParam(value = "orders") List<Order> orders);

    @GetMapping("/order/queryRefundParam")
    Map<String,Object> queryRefundParam(@RequestParam(value = "mainOrder") String orderNum);

    /**
     * 修改订单的groupId
     * @param orderNum
     * @param groupId
     */
    @PostMapping("/order/updateOrderGroup")
    void updateOrderGroup(@RequestParam(value = "orderNum") String orderNum,@RequestParam(value = "groupId") Integer groupId);

    /**
     * 将订单改为开团成功
     * @param groupId
     * @param status
     */
    @PostMapping("/order/updateOrderGroupStatus")
    void updateOrderGroupStatus(@RequestParam(value = "groupId") Integer groupId,@RequestParam(value = "status") Integer status);

}
